
import LangServing from '@/server/storage.server'

export  default  function (input) {

  var d ;
  try{
    d = new Date(input)
  }catch (err){
    return ''
  }
  var year = d.getFullYear();
  var month = d.getMonth() + 1;
  if(month<10){
    month='0'+month
  }
  var day = d.getDate() <10 ? '0' + d.getDate() : '' + d.getDate();
  var hour = d.getHours() <10 ? '0' + d.getHours() : '' + d.getHours();
  var minutes = d.getMinutes() <10 ? '0' + d.getMinutes() : '' + d.getMinutes();
  var seconds = d.getSeconds() <10 ? '0' + d.getSeconds() : '' + d.getSeconds();
  if(LangServing.getLang() === 'en'){
    return   month + '-' + day + '-' + year+  ' ' + hour + ':' + minutes + ':' + seconds;

  }
  return  year+ '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds;
}
